import java.awt.*;
import java.awt.image.BufferedImage;

public class heli {
	String text = "test";
	// boolean start=false;
	// haupt parent;
	boolean down = true;
	int x, y, z = 0;
	BufferedImage[] bilder;
	int i = 0;
	boolean domove = false;

	public heli(BufferedImage[] i, int x, int y) {
		this.bilder = i;
		this.x = x;
		this.y = y;

	}

	public void drawObject(Graphics g) {
		// super.paintComponent(g);
		// if(start){
		if (this.y <= 0) {
			this.y = 0;
		}
		if (this.y >= 540) {
			this.y = 540;
		}
		if (this.x <= 0) {
			this.x = 0;
		}
		/*
		 * if (this.x >= 840) { this.x = 840; }
		 */
		g.drawImage(bilder[z], this.x, this.y, null);

		// System.err.println(x+" "+y+" "+z);
		++this.z;
		this.z = (z == 4) ? 0 : this.z;
		// g.drawString(,x,y);
		// }
	}
}